﻿using JetBrains.ReSharper.Daemon.UsageChecking;
using JetBrains.ReSharper.Psi;
using JetBrains.Annotations;
using JetBrains.Application;

namespace Bddify.ReSharper
{
    [ShellComponent]
    public class SuppressUnusedBddifyElements : IUsageInspectionsSupressor
    {
        public bool SupressUsageInspectionsOnElement(IDeclaredElement element, out ImplicitUseKindFlags flags)
        {
            flags = (ImplicitUseKindFlags)0;
            
            var method = element as IMethod;
            if (method != null && method.ShortName.StartsWith("Give"))
            {
                flags = ImplicitUseKindFlags.Default;
                return true;
            }
            return false;
        }
    }
}
